const AUTH_SUCCESS = ' AUTH_SUCCESS'
const USER_ERROR_MSG = 'USER_ERROR_MSG'
const LOAD_DATA = 'LOAD_DATA'
const LOGOUT = 'LOGOUT'
const REGISTER_SUCCESS = 'REGISTER_SUCCESS'
const LOGIN_SUCCESS = 'LOGIN_SUCCESS'
const initialState = {
    
}
// rxreducer
// rxaction
  const user = (state = initialState,action) => {
    switch (action.type) {
    case REGISTER_SUCCESS:
            return { ...state, ...action.payload}
    case LOGIN_SUCCESS:
            return {...state,redirectTo:'home',...action.payload}
    case USER_ERROR_MSG:
            return {...action.payload }
    default:
        return state
    }
}
export default user
